import { Navigate } from "react-router-dom"
import { message } from "antd"
import { Local } from "@/utils/local"
function Guard({ children }: { children: any }) {
    const userinfo = Local.get_info()
    if (!userinfo.username) {
        message.warning("请登录")
        return <Navigate to="/home"></Navigate>
    } else {
        return (children)
    }

}

export default Guard